﻿Imports System.IO
Public Class Form2

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        OpenFileDialog1.InitialDirectory = "C:\settings\"
        OpenFileDialog1.ShowDialog()
        TextBox1.Text = OpenFileDialog1.FileName
        Dim fs As New FileStream(TextBox1.Text, FileMode.Open)
        Dim fr As New StreamReader(fs)
        TextBox2.Text = fr.ReadToEnd()
        fr.Close()
        fs.Close()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not Directory.Exists("C:\settings") Then
            Directory.CreateDirectory("C:\settings")
        End If
        SaveFileDialog1.InitialDirectory = "C:\settings\"
        SaveFileDialog1.ShowDialog()
        TextBox1.Text = SaveFileDialog1.FileName
        Dim fs As New FileStream(TextBox1.Text, FileMode.Create)
        Dim fr As New StreamWriter(fs)
        fr.Write(TextBox2.Text)
        fr.Close()
        fs.Close()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        MsgBox("To save a watchlist make stocks on one line seperated by a comma")
    End Sub

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class
